{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from sklearn.linear_model import LogisticRegression\n",
    "from sklearn import datasets\n",
    "from sklearn.model_selection import train_test_split\n",
    "from sklearn.metrics import  f1_score\n",
    "from sklearn.metrics import  confusion_matrix\n",
    "from sklearn.metrics import recall_score\n",
    "from sklearn.metrics import precision_score\n",
    "from matplotlib import pyplot as plt\n",
    "from sklearn.metrics import precision_recall_curve\n",
    "from KNN import metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "digits=datasets.load_digits()\n",
    "X=digits.data\n",
    "y=digits.target\n",
    "y[y==9] = 1\n",
    "y[y!=1]=0"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "X_train,X_test,y_train,y_test=train_test_split(X,y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "LogisticRegression(C=1.0, class_weight=None, dual=False, fit_intercept=True,\n",
       "          intercept_scaling=1, max_iter=100, multi_class='ovr', n_jobs=1,\n",
       "          penalty='l2', random_state=None, solver='liblinear', tol=0.0001,\n",
       "          verbose=0, warm_start=False)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lgr=LogisticRegression()\n",
    "lgr.fit(X_train,y_train)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "scores=lgr.decision_function(X_test)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "min=scores.min()\n",
    "max=scores.max()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [],
   "source": [
    "arg=np.arange(min,max,0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "precisions=[]\n",
    "recalls=[]\n",
    "thres=[]\n",
    "scores=lgr.decision_function(X_test)\n",
    "for i in arg:\n",
    "    thres.append(i)\n",
    "    recalls.append(recall_score(y_test,np.array(scores>i,dtype='int')))\n",
    "    precisions.append(precision_score(y_test,np.array(scores>i,dtype='int')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a12f31ac8>]"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xl0FfX9//HnO/tCyAJh3/fFFSJqXRBFRVzQaqu2ta3a4retWpfWpVprte2ptbW/tmoVrVs3q1VbUBTFouKCsigICBjCFtZA2EIgIcnn98dcTAgJuUnuzcy9eT3OyZn93teZE95MZj7z+ZhzDhERiV8JfgcQEZHoUqEXEYlzKvQiInFOhV5EJM6p0IuIxDkVehGROKdCLyIS51ToRUTinAq9iEicS/Lrizt37uz69evn19eLiMSk+fPnb3XO5TfnGN8Kfb9+/Zg3b55fXy8iEpPMbE1zj9GtGxGROKdCLyIS51ToRUTinAq9iEicU6EXEYlzTRZ6M3vCzLaY2eJGtpuZ/dHMCs1skZmNinxMERFpqXCu6J8CJhxm+znA4NDPZODPrY8lIiKR0mQ7eufcO2bW7zC7TAKecd6YhHPMLMfMujvnNkYo40Hmri5l9oqSaHy0tHM9c9O59Lg+fseQpjgHcx+Hsi1+J2m5oROg5+g2+7pIvDDVE1hXZ7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tuZt8CzgPOcKEbVc65CqAiND/fzFYCQ4CIP+hpST7CG50rYprK2MgxgTmHjWjTc3hAuFnN7DHg5SjHCYcv56k5nHMbQtMtZvYS3u2mIBb6zWbW3Tm30cy6A1v8DlSXc27zgflwf/9i4taNmU0AbgUucM6V11mfb2aJofkBwGCgKCj58EbeuszMUs2sfyjfR22d73CCcg4PI3DnMPSP/4CLgMWN7duGwhkJzjdmlmlmWQfm8RowBOG8NaTuiHnfAhr7a9MXLfr98/upd5hPngvx7j9+Evp5JLT+YmAJXguDBcD5QcoX2nYHXmuI5cA5Pp7Di/Cu+iqAzcCMgJ3DBvMF6RzWyfNX4FNgEV5R6O53plCuicCK0Lm6w+889bINCP2OLQz9vgUiH/BPvNuX+0O/f1cDnYA3gc9D07yA5Wv275/ejBURiXMxcetGRERaToVeRCTOqdCLiMQ5FXoRkTinQi8iEudU6EVE4pwKvYhInFOhFxGJc/8fQC2bcEjVnsoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a12f31b00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(thres,recalls)\n",
    "plt.plot(thres,precisions)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a1315a320>]"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAHipJREFUeJzt3Xt0VPW99/H3N3cSSLgkAhICqAGkiAIRtV5QvBTxWkUL1lZ7PKV2ST1P7dXT1ro8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r3fuY6aQux3yYC3THcBLwM45z4EsmidR8XXXM65Hc65m5xzo2ntB5xz+2KcqyOd7Y7OifVBhSgenEgDNtL66+fRgyafaTNmNK0HVooDlqs47PF1tN7kxNdMbca/Q9ccUPXyXfUPe/x5YEEAMk0Efhd6nE/rr9J9/M4VGjcM2EzomhW/M9G6K/TO0OMzaS2rmGbzmCsfSAk9/gnwUKy/r9BnDab9A6rXcOwB1YVR/eyu+A+M4hc1CVgXKvAfhJY9ROtWOrT+Gr8LWBr6MysguR4DykKZ5p2oaLsqU5uxXVLuHr+rn4W+q2Wh72p4ADIZ8CtgFbACmBKE7yr0/EHg4a7I4/G7GgF8EPr5LQWuCkiuycD60JhngMwuyPQiUAk00rqVfhdwN3B32N+rJ0KZV0T736CuUBURSUDxtM9dREQ8UrmLiCQglbuISAJSuYuIJCCVu4hIAlK5i4gkIJW7iEgCUrmLiCSg/w+B/wu6Jvpw+QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a130bf908>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(precisions,recalls)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [],
   "source": [
    "ps,rs,ts=precision_recall_curve(y_test,lgr.decision_function(X_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a12e62f60>]"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFU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fu8obPoLd8Z4/wu3A3xgxzp52IvAZ8Vc9D7qw81WgN1ec6GHQRcK5xddbVs418188CEfkcq/ukKT4oJ7IKV57YsAqXiDixgv09Y8xndR+vHfbGmGki8qKIxBtjmmVuEjd+V036eXPDBcASY8yuug/Y/d657BKRJGPMDld3VUE9bfKwjg8clgLMaYbaAK/7zh4RUN0ydfoyLwVW1dPMnZWnmqq+84E/ABcbY8qO0SZSRKIPX8c6oFPfv8MTvHoVLlff/uvAWmPMs8do0+bwMQARGYD1md/TTPW587uaAvzONWpmIFB8uBuimVzFMbpk7Hzvaqn9+boemFxPm2+BESLS0tXVOsJ1X5Pzwu/sL5rz6K3dF+AdYCWwAutDk+S6vy0wrVa7kVgjL3Kwukuaq75srL7DZa7Ly3Xrwxq5stx1Wd3U9dX3XgCPY32YAcKAj121/wx0aMb3ayjWf79X1HrPRgK3Abe52ox3vU/LsQ54DW7G+ur9XdWpT4AJrvd3JZDZjPVFYIV1TK37bHvvsP7I7AAqsfbGx2Idv5kJbHT9jHO1zQT+V+u5N7k+g9nAjc1Yn9d9Zw9f9AxVpZTyQwHVLaOUUoFCw10ppfyQhrtSSvkhDXellPJDGu5KKeWHNNyVUsoPabgrpZQf0nBXSik/9P8BYjv11If24v0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a12e62e48>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(ts,rs[:-1])\n",
    "plt.plot(ts,ps[:-1])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a132d4a90>]"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AA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Kx7FLKFi+f3WXsErdyPO1G3mSUAvwK+F7VEbedlsvEXgDzn3CnAq8CjEU/lnZf8idQfmplA/V7vw2bWNcK52sLThO8NrgTmOudqI5inrbzknwr81TmXS/3hgccbfj9ihZdtmA6cZ2argPOAnUBNpIOFUVveZ20WSz/McGhtMu8MYCTwupltpf4417wY+1C11QnJnXP7nXOVDXcfAqIz4643XidUf945V+2c2wJspL7sY4WXbfiXK4mtQzLgLf/1wFMAzrl3gVTqr3cSK7z8HhQ7577onBsD/LDhsUPRi3jC2vI+a7OglftxJ/N2zh1yzmU55/Kcc3nUf6A62Tm3wp+4zWp1QvImx+UmAxuimK81XiZUfw44H8DMsqg/TLM5qimPz8s2YGZDgZOAd6OcrzVe8m8HLgQws+HUl3tJVFMen5ffg6xGf238AJgV5Ywnah7wnw1nzZwFHHLO7QrXi3uaQzVeOG+Tecc0j9twm5lNpv5P0APUnz0TEzzmXwB8zszWA7XAHc65/f6l/qQ2vI+mAnNcw6kPscJj/u8BD5nZd6k/FHBNLG2Hx22YAPzEzBz1Z7/d7FvgZpjZbOozZjV8tnE3kATgnPsT9Z91XAIUAuXAtWFdfwz9PEVEJEyCdlhGRERQuYuIBJLKXUQkgFTuIiIBpHIXEQkglbuISACp3EVEAkjlLiISQP8fLz/R+bJyxbcAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a130cdb00>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(ps,rs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "tprs=[]\n",
    "fprs=[]\n",
    "thres=[]\n",
    "scores=lgr.decision_function(X_test)\n",
    "for i in arg:\n",
    "    thres.append(i)\n",
    "    tprs.append(metrics.TPR(y_test,np.array(scores>i,dtype='int')))\n",
    "    fprs.append(metrics.FPR(y_test,np.array(scores>i,dtype='int')))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'list' object has no attribute 'shape'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-54-4395455f3706>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0mplt\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mplot\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mfprs\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0mtprs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0mtprs\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mshape\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m: 'list' object has no attribute 'shape'"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzt3Xd4FOX+/vH3J40QSmhBkNDBQkcivQpKEUGawlGwYwMVy/erP/XYy7ECIgIqIigH21ERUVDpTQhSpBMiSASkI70+vz+y+M0JgSzJJrPZ3K/rysWW2dnbYbyZPDv7jDnnEBGR0BLmdQAREQk8lbuISAhSuYuIhCCVu4hICFK5i4iEIJW7iEgIUrmLiIQglbuISAhSuYuIhKAIr964VKlSrlKlSl69vYhInrR48eKdzrm4zJbzrNwrVapEYmKiV28vIpInmdkmf5bTsIyISAhSuYuIhCCVu4hICFK5i4iEI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nYB1pB41Pu577Fmgi+92NPAZqR+YLgSqpHnt477XrSXNmQgZrTO38wFPAAeBpWl+SgOFgMXAclI/aB0ChHuUsYcvwzLgF+CaNOtMIHUn3QAMw/elN4/+nlsDC9KtL6Db0Y98l5N65HcQ2AWsTPPaW325k0gd8vBqG2aYEbgROJ5uX6zne24a8Ksv50dAYY8yNvXlWOb787Y066zi2yeSfPtIAY/+nisBfwBh6dYZ0G0YiB99Q1VEJAQFw7CMiIgEmMpdRCQEqdxFREKQyl1EJASp3EVEQpDKXUQkBKncRURCkMpdRCQE/X/TNSdDYf+U0AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x1a1353bda0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(fprs,tprs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sklearn.metrics import roc_curve"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [],
   "source": [
    "ps,rs,ts=roc_curve(y_test,lgr.decision_function(X_test))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x1a13415be0>]"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXcAAAD8CAYAAACMwORRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAD/hJREFUeJzt3XGonXd9x/H3x2adjDW6LleITWoyloLXMqxcmoowK7qRFmz+cS6R4hzFqlsdTBl0OKrUv6ZsgiybZltxCrFW/zAXiRTmKg4xWa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Figure at 0x1a13345048>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(ps,rs)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([0.        , 0.        , 0.00273973, 0.00273973, 0.00547945,\n",
       "       0.00547945, 0.00821918, 0.00821918, 0.0109589 , 0.0109589 ,\n",
       "       0.01369863, 0.01369863, 0.01643836, 0.01643836, 0.01917808,\n",
       "       0.01917808, 0.02465753, 0.02465753, 0.02739726, 0.02739726,\n",
       "       0.03561644, 0.03561644, 0.04109589, 0.04109589, 0.04657534,\n",
       "       0.04657534, 0.05205479, 0.05205479, 0.05479452, 0.05479452,\n",
       "       0.0630137 , 0.0630137 , 0.06575342, 0.06575342, 0.06849315,\n",
       "       0.06849315, 0.07123288, 0.07123288, 0.0739726 , 0.0739726 ,\n",
       "       0.09589041, 0.09589041, 0.11232877, 0.11232877, 0.11780822,\n",
       "       0.11780822, 0.12876712, 0.12876712, 0.20821918, 0.20821918,\n",
       "       0.26575342, 0.26575342, 0.38630137, 0.38630137, 1.        ])"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
